fix: Guard contains() against null in proxy_client_password_auth_type validation#96
Conversation
On OpenTofu <1.10, the || operator does not short-circuit when the left operand is true, causing contains() to receive a null argument and fail with "argument must not be null". Replace with a ternary to ensure contains() is never called when the variable is null. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 44 minutes and 28 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
💥 This pull request now has conflicts. Could you fix it @vyrwu? 🙏 |
What
Replace
||with a ternary in theproxy_client_password_auth_typevariable validation to preventcontains()from receiving anullargument.Why
On OpenTofu <1.10 (confirmed on v1.9.1), the
||operator does not short-circuit evaluation. Whenproxy_client_password_auth_typeisnull(the default), both sides of the||are evaluated, andcontains()receivesnullas its second argument, causing:This means any user on OpenTofu <1.10 who has not set
proxy_client_password_auth_typewill hit a plan failure with the current default ofnull.Fix
The ternary guarantees
contains()is never called when the value isnull.Generated with Claude Opus 4.6